<template>
<section class="oa-form__table">
  <h5>{{approve.name}}</h5>
    <table cellpadding="0" cellspacing="0">
    <tr v-if="$route.query.from != 'new'">
      <td>事务编号</td>
      <td>{{approve.name}}<span v-if="approve && approve.code">{{approve.code}}</span></td>
    </tr>
    <tr>
      <td>流程名称</td>
      <td>
        <span v-if="$route.query.from == 'new'">
          新建{{approve.name}}
        </span>
        <span v-else>
          {{approve.approve_name}}
        </span>
      </td>
    </tr>
    <tr>
      <td>申请事由</td>
      <td :title="reason"><el-input placeholder="申请事由" type="textarea" v-model="reason" :disabled="$route.query.from != 'new'"/></td>
    </tr>
  </table>
  <h3 class="oa-form__table-title">
    <span v-if="$route.query.from === 'new'">{{approve.name}}</span>
    <span v-else>
      {{approve.approve_name}}
    </span>
  </h3>
  <table widtd="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td class="_name">业务人员</td>
      <td>
        <el-select v-model="value" placeholder="请选择" :disabled="$route.query.from != 'new'"  @change="selectStaff($event)">
            <el-option
              v-for="item in staff"
              :key="item.value"
              :label="item.label"
              :value="item">
            </el-option>
          </el-select>
      </td>
      <td class="_name">客户名称</td>
      <td>
        <el-input placeholder="客户名称"  v-model="customer" :disabled="$route.query.from != 'new'"/>
      </td>
      <td class="_name">合同编号</td>
      <td colspan="3">
        <el-input placeholder="合同编号" v-model="hetong" :disabled="$route.query.from != 'new'"/>
      </td>
    </tr>
    <tr>
      <td rowspan="4">
        媒体类别
        <span class="red">（航空媒体）</span>
      </td>
      <td class="_name">B737-800型客机</td>
      <td colspan="6"><el-input placeholder="架" v-model="b800" :disabled="$route.query.from != 'new'"/>架</td>
    </tr>
    <tr>
      <td class="_name">B737-700型客机</td>
      <td colspan="6"><el-input placeholder="架" v-model="b700" :disabled="$route.query.from != 'new'"/>架</td>
    </tr>
    <tr>
      <td class="_name">B757-200型客机</td>
      <td colspan="6"><el-input placeholder="架"  v-model="b200" :disabled="$route.query.from != 'new'"/>架</td>
    </tr>
    <tr>
      <td class="_name">B787型客机</td>
      <td colspan="6"><el-input placeholder="架"  v-model="b787" :disabled="$route.query.from != 'new'"/>架</td>
    </tr>
    <tr>
      <td class="_name">预订发布日</td>
      <td colspan="2">
         <el-date-picker
          v-model="ydfbr"
          :disabled="$route.query.from != 'new'"
          value-format="yyyy-MM-dd"
          type="date"
          placeholder="选择日期">
        </el-date-picker>
      </td>
      <td class="_name" colspan="3">发布期限</td>
      <td colspan="2">
        <el-input placeholder="发布期限"   v-model="fbqx" :disabled="$route.query.from != 'new'"/>
      </td>
    </tr>
    <tr>
      <td colspan="8">工 作 流 程 单</td>
    </tr>
    <tr>
      <td colspan="2">版面内容</td>
      <td colspan="2">
        <el-input placeholder="版面内容" v-model="bmnr"  :disabled="$route.query.from != 'new'"/>
      </td>
      <td colspan="2">优惠条款</td>
      <td colspan="2">
        <el-select v-model="discount" placeholder="请选择优惠条款" :disabled="$route.query.from != 'new'">
            <el-option
              v-for="item in discounts"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
      </td>
    </tr>
    <!-- <tr>
      <td colspan="8">
        <el-checkbox-group v-model="checkList">
          <el-checkbox label="公章"></el-checkbox>
          <el-checkbox label="财务章"></el-checkbox>
          <el-checkbox label="法人章"></el-checkbox>
          <el-checkbox label="合同章"></el-checkbox>
          <el-checkbox label="发票专用章"></el-checkbox>
          <el-checkbox label="监事会章"></el-checkbox>
          <el-checkbox label="董事会章"></el-checkbox>
        </el-checkbox-group>
      </td>
    </tr>
    <tr>
      <td>
        发布点位确认
        <span class="red">（客服部）</span>
      </td>
      <td>&nbsp;</td>
      <td class="_name">
        合同拟定
        <span class="red">（客服部）</span>
      </td>
      <td>黄菊兰2020年03月24 日</td>
      <td class="_name">
        合同初审
        <span class="red">（财务部）</span>
      </td>
      <td>刘小娇2020年03 月24日</td>
      <td class="_name">
        合同终审1
        <span class="red">（副总）</span>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="_name">
        合同终审2
        <span class="red">（董事长）</span>
      </td>
      <td>林一城2020年03月25日</td>
      <td class="_name">
        合同盖章
        <span class="red">（财务部）</span>
      </td>
      <td>刘小娇2020年03月25 日</td>
      <td class="_name">
        合同签收确认
        <span class="red">（业务员）</span>
      </td>
      <td>&nbsp;</td>
      <td class="_name">
        合同扫描
        <span class="red">（客服部）</span>
      </td>
      <td>
        黄菊兰2020年
        <span class="red">04月07日</span>
      </td>
    </tr>
    <tr>
      <td class="_name">
        合同存档
        <span class="red">（财务部）</span>
      </td>
      <td>刘小娇2020年04月07日</td>
      <td class="_name">
        素材提供
        <span class="red">（客服部）</span>
      </td>
      <td>刘小娇2020年04月07日</td>
      <td class="_name">
        版面设计
        <span class="red">（客服部）</span>
      </td>
      <td>刘小娇2020年04月07日</td>
      <td class="_name">
        稿件确认
        <span class="red">（业务员）</span>
      </td>
      <td>刘小娇2020年04月07日</td>
    </tr>
    <tr>
      <td colspan="4" class="_name">
        版面制作、上画、照片、视屏提供
        <span class="red">（客服部）</span>
      </td>
      <td colspan="4">黄菊兰 2020年04月08日</td>
    </tr>
    <tr>
      <td colspan="8" class="_name">
        款项支付明细
        <span class="red">（财务部）</span>
      </td>
    </tr> -->
    <tr>
      <td class="_name">合同总额</td>
      <td><el-input placeholder="合同总额" v-model="htzje" :disabled="htzjeFlag"/>元</td>
      <td class="_name">首付款金额</td>
      <td colspan="2"><el-input placeholder="首付款金额" v-model="sfkje" :disabled="sfkjeFlag"/>元</td>
      <td class="_name">到款时间</td>
      <td colspan="2">
        <el-date-picker
            v-model="dksj"
            :disabled="dksjFlag"
            value-format="yyyy-MM-dd"
            type="date"
            placeholder="到款时间">
          </el-date-picker>
      </td>
    </tr>
    <!-- <tr>
      <td colspan="8">上刊情况</td>
    </tr>
    <tr>
      <td class="_name">
        派单上画
        <span class="red">（客服部）</span>
      </td>
      <td>&nbsp;</td>
      <td class="_name">
        具体发布时间
        <span class="red">（客服部）</span>
      </td>
      <td>&nbsp;</td>
      <td rowspan="7" class="_name">
        发布过程中存在问题 备注
        <span class="red">（客服部）</span>
      </td>
      <td colspan="3" rowspan="7">
        <el-input type="textarea" :rows="3" placeholder="备注" />
      </td>
    </tr>
    <tr>
      <td class="_name">
        验收函拟定
        <span class="red">（客服部）</span>
      </td>
      <td>&nbsp;</td>
      <td class="_name">
        验收函审核、盖章
        <span class="red">（财务部）</span>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="_name">
        验收函签收确认
        <span class="red">（业务员）</span>
      </td>
      <td>&nbsp;</td>
      <td class="_name">
        验收函扫描
        <span class="red">（客服部）</span>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="_name">
        验收函归档
        <span class="red">（财务部）</span>
      </td>
      <td colspan="2">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="_name">
        各类函件拟定
        <span class="red">（客服部）</span>
      </td>
      <td>&nbsp;</td>
      <td class="_name">
        各类函件审核
        <span class="red">（副总）</span>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="_name">
        各类函件盖章
        <span class="red">（财务部）</span>
      </td>
      <td>&nbsp;</td>
      <td class="_name">
        各类函件签收确认
        <span class="red">（业务员）</span>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="_name">
        各类函件扫描
        <span class="red">（客服部）</span>
      </td>
      <td>&nbsp;</td>
      <td class="_name">
        各类函件归档
        <span class="red">（财务部）</span>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="8" class="_name">
        款项到账情况
        <span class="red">（财务部）</span>
      </td>
    </tr> -->
    <tbody v-for = "item in 3" :key = "item">
         <tr>
          <td class="_name">{{`第${indexes[item-1]}期到款金额`}}</td>
          <td colspan="3">
            <el-input :placeholder="`第${indexes[item-1]}期到款金额`" v-model="money[`dkje${item+1}`]"  :disabled="money[`dkje${item+1}Flag`]"/>
          </td>
          <td class="_name">{{`第${indexes[item-1]}期到款时间`}}</td>
          <td colspan="3">
            <el-date-picker
              v-model="money[`dksj${item+1}`]"
              :disabled="money[`dksj${item+1}Flag`]"
              value-format="yyyy-MM-dd"
              type="date"
              :placeholder="`第${indexes[item-1]}期到款时间`">
            </el-date-picker>
          </td>
        </tr>
      </tbody>
    <!-- <tr>
      <td colspan="8" class="oa-form__table-head">
        特殊流程单申请（业务人员填写）
      </td>
    </tr>
    <tr>
      <td class="_name">申请人</td>
      <td>&nbsp;</td>
      <td class="_name">日期</td>
      <td>&nbsp;</td>
      <td class="_name">发布确认单是否提供</td>
      <td colspan="3">
        <el-radio v-model="radio" :label="1">是</el-radio>
        <el-radio v-model="radio" :label="2">否</el-radio>
      </td>
    </tr>
    <tr>
      <td class="_name">原因1，合同未归档，款 未到</td>
      <td colspan="7">&nbsp;</td>
    </tr>
    <tr>
      <td class="_name">原因2，合同已归档，款 未到</td>
      <td colspan="7">&nbsp;</td>
    </tr>
    <tr>
      <td class="_name">原因3，合同未归档，款 已到 合同金额</td>
      <td>元</td>
      <td class="_name">财务审批</td>
      <td colspan="2">
        <el-input placeholder="财务审批" />
      </td>
      <td class="_name">领导审批</td>
      <td colspan="2">
        <el-input placeholder="领导审批" />
      </td>
    </tr> -->
    <tr>
      <td colspan="8" class="oa-form__table-hd">
        附件1（厦航，发布点位明细）
      </td>
    </tr>
    <tr class="_name">
      <td>序号</td>
      <td>机型</td>
      <td>型号</td>
      <td>上刊时间</td>
      <td>可调客户</td>
      <td>备注1</td>
      <td>备注2</td>
      <td>备注3</td>
    </tr>
    <tr>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
      <td></td>
    </tr>
  </table>
  <!-- <table cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="6" class="oa-form__table-hd">事务信息(重要等级:一般)办理意见</td>
    </tr>
    <tr class="_name">
      <td>序号</td>
      <td>步骤名称</td>
      <td>办理人</td>
      <td>办理时间</td>
      <td>状态</td>
      <td>办理意见</td>
    </tr>
    <tr>
      <td>1</td>
      <td>验收函盖章</td>
      <td>刘小娇</td>
      <td>2020-04-26 17:44:29</td>
      <td>
        <span class="status">同意</span>
      </td>
      <td>
        同意
      </td>
    </tr>
  </table> -->
  <history :process="process"></history>
  <files></files>
  <!-- <table cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="6" class="oa-form__table-hd">流程进度</td>
    </tr>
    <tr class="_name">
      <td>进度序号</td>
      <td>步骤名称</td>
      <td>办理人</td>
      <td>开始时间</td>
      <td>状态</td>
      <td>持续时间</td>
    </tr>
    <tr>
      <td>1</td>
      <td>开始</td>
      <td>黄菊兰</td>
      <td>2020-03-24 17:46</td>
      <td>已办理</td>
      <td>持续时间</td>
    </tr>
  </table> -->
</section>
</template>
<script>
import { save, info, getAutoKey } from '@/api/oa/index.js'
import history from './components/process'
import files from './components/files'
import mixin from '@/mixins/index.js'
const obj = {}
for (var i = 1; i < 11; i++) {
  obj['xdrq' + i] = ''
  obj[`xdrq${i}Flag`] = true
  obj['fbnr' + i] = ''
  obj[`fbnr${i}Flag`] = true
  obj['width' + i] = ''
  obj[`width${i}Flag`] = true
  obj['num' + i] = ''
  obj[`num${i}Flag`] = true
  obj['height' + i] = ''
  obj[`height${i}Flag`] = true
  obj['sksj' + i] = ''
  obj[`sksj${i}Flag`] = true
  obj['phbz' + i] = ''
  obj[`phbz${i}Flag`] = true
}
const indexes = ['二', '三', '四']
const money = {}
for (var j = 0; j < 3; j++) {
  money[`dksj${j + 2}`] = ''
  money[`dksj${j + 2}Flag`] = true
  money[`dkje${j + 2}`] = ''
  money[`dkje${j + 2}Flag`] = true
}
export default {
  mixins: [mixin],
  components: { history, files },
  props: ['curDepartment', 'userInfo', 'approve', 'staff', 'departments', 'addDofield', 'process'],
  data () {
    return {
      checkList: [],
      reason: '',
      flag: false,
      value: '',
      valueFlag: true,
      department: '',
      obj,
      money,
      indexes,
      truename: '',
      customer: '',
      hetong: '',
      b800: '',
      b700: '',
      b200: '',
      b787: '',
      ydfbr: '',
      fbqx: '',
      bmnr: '',
      discount: '',
      discounts: [{
        value: '无',
        label: '无'
      }, {
        value: '赠送画面次数（含首次）',
        label: '赠送画面次数（含首次）'
      }, {
        value: '赠送画面次数（不含首次）',
        label: '赠送画面次数（不含首次）'
      }, {
        value: '其他',
        label: '其他'
      }],
      field_ids: [],
      field_vals: [],
      htzje: '',
      htzjeFlag: true,
      sfkje: '',
      sfkjeFlag: true,
      dksj: '',
      dksjFlag: true,
      bsqkbz: '',
      bsqkbzFlag: true,
      file_paths: [],
      file_names: []
    }
  },
  computed: {
    uploadArr () {
      return this.$store.state.uploadArr
    }
  },
  created () {
    this.file_paths = []
    this.file_names = []
    if (this.$route.query.from === 'new') {
      this.disabled = true
    } else {
      this.infoFunc()
    }
    this.reset()
  },
  methods: {
    // 获取field_ids  field_vals
    renderCustom () {
      console.log('change', this.autoField)
      this.autoField && this.autoField.forEach(e => {
        this.judge(e)
        if (e.val) {
          this.field_ids.push(e.approve_field_id)
          this.field_vals.push(e.val)
        }
        return e
      })
      console.log(this.field_ids, this.field_vals)
    },
    reset () {
      const obj = {}
      for (var i = 1; i < 11; i++) {
        obj['xdrq' + i] = ''
        obj[`xdrq${i}Flag`] = true
        obj['fbnr' + i] = ''
        obj[`fbnr${i}Flag`] = true
        obj['width' + i] = ''
        obj[`width${i}Flag`] = true
        obj['num' + i] = ''
        obj[`num${i}Flag`] = true
        obj['height' + i] = ''
        obj[`height${i}Flag`] = true
        obj['sksj' + i] = ''
        obj[`sksj${i}Flag`] = true
        obj['phbz' + i] = ''
        obj[`phbz${i}Flag`] = true
      }
      this.obj = obj
      const money = {}
      for (var j = 0; j < 3; j++) {
        money[`dksj${j + 2}`] = ''
        money[`dksj${j + 2}Flag`] = true
        money[`dkje${j + 2}`] = ''
        money[`dkje${j + 2}Flag`] = true
      }
      this.money = money
    },
    getData () {
      if (this.uploadArr.length > 0) {
        this.uploadArr.forEach(item => {
          this.file_paths.push(item.path)
          this.file_names.push(item.name)
        })
      }
      console.log(this.approve)
      const params = {
        // token: window.localStorage.getItem('token'),
        openid: window.localStorage.getItem('token'),
        reason: this.reason,
        approve_id: this.approve.id,
        department_id: this.department,
        apply_date: this.applyTime,
        truename: this.truename
      }
      // if (this.file_paths.length > 0) {
      //   const paths = new Set(this.file_paths)
      //   const names = new Set(this.file_names)
      //   params.file_paths = Array.from(paths).join()
      //   params.file_names = Array.from(names).join()
      // }
      const paths = new Set(this.file_paths)
      const names = new Set(this.file_names)
      params.file_paths = Array.from(paths).join()
      params.file_names = Array.from(names).join()
      this.addDofieldRender()
      params.field_ids = this.field_ids.join()
      params.field_vals = this.field_vals.join()
      if (!this.reason) {
        this.$message.error('请输入申请原因')
        return false
      }
      save(params).then((res) => {
        const { status } = res
        if (status) {
          this.$message.error('提交成功')
          this.$router.push({ name: 'oaList', query: { activeName: 4 } })
        }
      })
      this.$store.commit('getUpload', [])
    },
    infoFunc () {
      const params = {
        // token: window.localStorage.getItem('token'),
        openid: window.localStorage.getItem('token'),
        approve_id: this.approve.approve_id,
        workflow_id: this.approve.workflow_id
      }
      info(params).then(res => {
        const { status, data: { workflow }, data: { fields }, data: { node } } = res
        if (status) {
          this.reason = workflow.reason
          this.contents = workflow.contents
          this.value = workflow.truename
          this.department = workflow.department_id
          window.localStorage.setItem('approve_node_id', workflow.approve_node_id)
          window.localStorage.setItem('is_end', workflow.is_end)
          this.nodeInfo(node)
          fields && fields.forEach(e => {
            if (e.field_name === '业务人员') {
              this.value = e.field_val
            }
            if (e.field_name === '业务人员') {
              this.value = e.field_val
            }
            if (e.field_name === '客户名称') {
              this.customer = e.field_val
            }
            if (e.field_name === '合同编号') {
              this.hetong = e.field_val
            }
            if (e.field_name === 'B737-800型客机') {
              this.b800 = e.field_val
            }
            if (e.field_name === 'B737-700型客机') {
              this.b700 = e.field_val
            }
            if (e.field_name === 'B757-200型客机') {
              this.b200 = e.field_val
            }
            if (e.field_name === 'B787型客机') {
              this.b787 = e.field_val
            }
            if (e.field_name === '预订发布日') {
              this.ydfbr = e.field_val
            }
            if (e.field_name === '发布期限') {
              this.fbqx = e.field_val
            }
            if (e.field_name === '版面内容') {
              this.bmnr = e.field_val
            }
            if (e.field_name === '优惠条款') {
              this.discount = e.field_val
            }
          })
          this.getAutoKey(workflow.approve_node_id)
        }
      })
    },
    nodeInfo (node) {
      node && node.forEach(e => {
        if (e.name === '点位最终确认') {
          e.fields && e.fields.forEach(j => {
            if (j.field_name === '预定点位确认') {
              this.yddwqd = j.field_val
            }
          })
        }
        if (e.name === '到款确认') {
          e.fields && e.fields.forEach(j => {
            for (let i = 0; i < 3; i++) {
              if (j.field_name === `第${indexes[i]}期到款金额`) {
                this.money[`dkje${i + 2}`] = j.field_val
              }
              if (j.field_name === `第${indexes[i]}期到款时间`) {
                this.money[`dksj${i + 2}`] = j.field_val
              }
              if (j.field_name === '特殊到期款情况备注') {
                this.bsqkbz = j.field_val
              }
            }
            return j
          })
        }
        if (e.name === '首付款确认') {
          e.fields && e.fields.forEach(j => {
            for (let i = 0; i < 3; i++) {
              if (j.field_name === '合同总额') {
                this.htzje = j.field_val
              }
              if (j.field_name === '首付款金额') {
                this.sfkje = j.field_val
              }
              if (j.field_name === '到款时间') {
                this.dksj = j.field_val
              }
            }
            return j
          })
        }
        if (e.name === '喷绘下单' || e.name === '下单制作') {
          e.fields && e.fields.forEach(j => {
            for (let i = 1; i < 11; i++) {
              if (j.field_name === `下单日期${i}`) {
                this.obj[`xdrq${i}`] = j.field_val
              }
              if (j.field_name === `发布内容${i}`) {
                this.obj[`fbnr${i}`] = j.field_val
              }
              if (j.field_name === `喷绘记录高${i}`) {
                this.obj[`height${i}`] = j.field_val
              }
              if (j.field_name === `喷绘记录数量${i}`) {
                this.obj[`num${i}`] = j.field_val
              }
              if (j.field_name === `喷绘记录宽${i}`) {
                this.obj[`width${i}`] = j.field_val
              }
              if (j.field_name === `派单上画${i}`) {
                this.obj[`sksj${i}`] = j.field_val
              }
              if (j.field_name === `喷绘记录备注${i}`) {
                this.obj[`phbz${i}`] = j.field_val
              }
            }
            return j
          })
        }
        return e
      })
    },
    submitFunc () {
      if (!this.flag) {
        this.flag = true
        this.getData()
        setTimeout(() => {
          this.flag = false
        }, 3000)
      }
    },
    addDofieldRender () {
      this.addDofield && this.addDofield.forEach(e => {
        this.judge(e)
        if (e.val) {
          this.field_ids.push(e.field_id)
          this.field_vals.push(e.val)
        }
        return e
      })
      console.log('add', this.addDofield)
    },
    // 选择申请人
    selectStaff (e) {
      this.truename = e.truename
      this.department = e.department_id
    },
    getAutoKey (id) {
      getAutoKey(id).then(res => {
        const { status, data } = res
        this.autoField = data
        if (status) {
          this.autoField && this.autoField.forEach(e => {
            this.judge(e)
            return e
          })
        }
      })
    },
    judge (e) {
      if (e.field_name === '业务人员') {
        this.$set(e, 'val', this.truename)
        this.valueFlag = false
      }
      if (e.field_name === '客户名称') {
        this.$set(e, 'val', this.customer)
        this.customerFlag = false
      }
      if (e.field_name === '合同编号') {
        this.$set(e, 'val', this.hetong)
        this.hetongFlag = false
      }
      if (e.field_name === 'B737-800型客机') {
        this.$set(e, 'val', this.b800)
        this.b800Flag = false
      }
      if (e.field_name === 'B737-700型客机') {
        this.$set(e, 'val', this.b700)
        this.b700Flag = false
      }
      if (e.field_name === 'B757-200型客机') {
        this.$set(e, 'val', this.b200)
        this.b200Flag = false
      }
      if (e.field_name === 'B787型客机') {
        this.$set(e, 'val', this.b787)
        this.b787Flag = false
      }
      if (e.field_name === '预订发布日') {
        this.$set(e, 'val', this.ydfbr)
        this.ydfbrFlag = false
      }
      if (e.field_name === '发布期限') {
        this.$set(e, 'val', this.fbqx)
        this.fbqxFlag = false
      }
      if (e.field_name === '版面内容') {
        this.$set(e, 'val', this.bmnr)
        this.bmnrFlag = false
      }
      if (e.field_name === '优惠条款') {
        this.$set(e, 'val', this.discount)
      }
      if (e.field_name === '合同总额') {
        this.$set(e, 'val', this.htzje)
        this.htzjeFlag = false
      }
      if (e.field_name === '首付款金额') {
        this.$set(e, 'val', this.sfkje)
        this.sfkjeFlag = false
      }
      if (e.field_name === '到款时间') {
        this.$set(e, 'val', this.dksj)
        this.dksjFlag = false
      }
      for (let i = 1; i < 11; i++) {
        if (e.field_name === `下单日期${i}`) {
          this.$set(e, 'val', this.obj[`xdrq${i}`])
          this.obj[`xdrq${i}Flag`] = false
        }
        console.log(e.field_name)
        if (e.field_name === `发布内容${i}`) {
          this.$set(e, 'val', this.obj[`fbnr${i}`])
          this.obj[`fbnr${i}Flag`] = false
          console.log(this.obj)
        }
        if (e.field_name === `喷绘记录宽${i}`) {
          this.$set(e, 'val', this.obj[`width${i}`])
          this.obj[`width${i}Flag`] = false
        }
        if (e.field_name === `喷绘记录数量${i}`) {
          this.$set(e, 'val', this.obj[`num${i}`])
          this.obj[`num${i}Flag`] = false
        }
        if (e.field_name === `喷绘记录高${i}`) {
          this.$set(e, 'val', this.obj[`height${i}`])
          this.obj[`height${i}Flag`] = false
        }
        if (e.field_name === `派单上画${i}`) {
          this.$set(e, 'val', this.obj[`sksj${i}`])
          this.obj[`sksj${i}Flag`] = false
        }
        if (e.field_name === `喷绘记录备注${i}`) {
          this.$set(e, 'val', this.obj[`phbz${i}`])
          this.obj[`phbz${i}Flag`] = false
        }
      }
      for (let i = 2; i < 5; i++) {
        if (e.field_name === `第${indexes[i - 2]}期到款金额`) {
          this.$set(e, 'val', this.money[`dkje${i}`])
          this.money[`dkje${i}Flag`] = false
        }
        if (e.field_name === `第${indexes[i - 2]}期到款时间`) {
          this.$set(e, 'val', this.money[`dksj${i}`])
          this.money[`dksj${i}Flag`] = false
        }
        if (e.field_name === '特殊到期款情况备注') {
          this.$set(e, 'val', this.bsqkbz)
          this.bsqkbzFlag = false
        }
      }
      // this.field_ids.push(e.field_id)
      // this.field_vals.push(e.val)
      // console.log(this.field_ids, this.field_vals)
    }
  }
}
</script>
